import React, { Component } from 'react'

export default class App extends Component {
  // handleClick = (params, e)=> {
  //   console.log(params, e)
  // }
  handleClick = (e)=> {
    console.log(e)
    console.log(e.currentTarget.dataset.msg)
  }
  render() {
    return (
      <div>
        {/* 利用bind */}
        {/* <button onClick={this.handleClick.bind(this, '🐂')}>传参</button> */}
        {/* 利用箭头函数 */}
        {/* <button onClick={(e)=>{
          this.handleClick('🐂', e)
        }}>传参</button> */}
        <button data-msg={'🐂'} onClick={this.handleClick}>传参</button>
      </div>
    )
  }
}
